<template>
  <div class="box">
    <header>
      <div class="title">
        <span @click="back()">&lt;</span>
        <p>综合缴费</p>
      </div>
    </header>
    <main>
      <div class="top">
        <p>新增缴费</p>
      </div>
      <div class="bottom">
        <figure>
          <figcaption v-for="(item, index) in serveitems" :key="index" @click="into(item.id)">
            <img :src="list[index].img" />
            <p>{{ item.serviceName }}</p>
          </figcaption>
        </figure>
      </div>
    </main>
    <footer>联系客服</footer>
  </div>
</template>

<script>
import { mapState, mapActions } from "vuex";
export default {
  data() {
    return {
      fatherid: 6,
    };
  },
  created() {
    this.servetype(this.fatherid);
  },
  computed: {
    ...mapState("servelist", ["serveitems"]),
    ...mapState("payment", ["list"]),
  },
  methods: {
    ...mapActions("servelist", ["servetype"]),
    into(id){
      this.$router.push("/recharge/"+id)
    },
    back(){
      this.$router.back()
    }
  },
};
</script>

<style lang="scss" scoped>
.box {
  position: relative;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 0 0.21rem;
  background: linear-gradient(#16cebb, #f4f4f4, #f4f4f4, #f4f4f4);
  header {
    height: 1.14rem;
    // background: #16CEBB;
    overflow: hidden;
    .title {
      margin-top: 0.2rem;
      width: 60%;
      height: 0.25rem;
      font-size: 0.18rem;
      line-height: 0.25rem;
      display: flex;
      justify-content: space-between;
      p {
        font-weight: 600;
        color: #333333;
      }
    }
  }
  main {
    height: 3.89rem;
    background: #ffffff;
    border-radius: 0.1rem;
    margin-top: -0.5rem;
    .top {
      box-sizing: border-box;
      padding: 0.11rem 0.16rem;
      p {
        width: 0.64rem;
        height: 0.22rem;
        font-size: 0.16rem;
        font-weight: 600;
        color: #333333;
        line-height: 0.22rem;
      }
    }
    .bottom {
      margin-top: 0.2rem;
      figure {
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
        figcaption {
          width: 26%;
          font-size: 0.12rem;
          text-align: center;
          height: 0.47rem;
          // background: rebeccapurple;
          margin-bottom: 0.6rem;
        }
        img {
          height: 0.47rem;
        }
        p {
          height: 0.17rem;
          font-weight: 400;
          color: #333333;
          line-height: 0.17rem;
        }
      }
    }
  }
  footer {
    width: 0.48rem;
    height: 0.17rem;
    font-size: 0.12rem;
    font-weight: 400;
    color: #999999;
    line-height: 0.17rem;
    position: absolute;
    bottom: 0.48rem;
    left: 44%;
  }
}
</style>
